<%= will_filter_scripts_tag %>

<%= form_tag({}, :id => "tr8n_form", :method => :get) do %>
  <%=hidden_field_tag(:mode, params[:mode]) %>
  <%=hidden_field_tag(:type, "translation_key") %>

  <%= will_filter_table_tag(@results, :columns => [
    [:icn, image_tag("tr8n/icons/key.png"), :title => "", :style => "width:12px;"],
    [:checkbox, 'ids'],     
    :id,
    [:label, lambda{|key|
      html = [link_to(key.label, :controller => "/tr8n/admin/translation_key", :action => :view, :id => key.id)]
      html << '<div style="color:grey; font-size:10px; padding-top:3px;">'
      html << key.description.to_s  
      html << '</div>'  
      html.join("").html_safe
    }],
    :locale,
    [:admin, lambda{|key| key.admin}, 'padding:5px;text-align:right;'],
    [:level, lambda{|key| key.level}, 'padding:5px;text-align:right;'], 
    [:translation_count, lambda{|key| link_to(key.translation_count || 0, :controller => "/tr8n/admin/translation_key", :action => :view, :id => key.id, :mode => :translations)}, 'padding:5px;text-align:right;'],
    [:created_at, lambda{|key| key.created_at}, 'padding:5px;text-align:right;'],
    [:actions, lambda{|key|
      tr8n_actions_tag([
        link_to_function("Update", "Tr8n.UI.Lightbox.show('/tr8n/admin/translation_key/lb_update?id=#{key.id}', {height:450})"),
        link_to_function("Delete", "deleteObjects('#{key.id}')")
      ])
    }, 'padding:5px;text-align:right;white-space:nowrap;']
  ]) %>

<% end %>

<%= will_filter_actions_bar_tag(@results, [
  ['Delete Selected Keys', 'deleteObjects()'],
]) %>
